// index.ts
import Request from './axios/index'

export const requestInstanceOne = new Request({
  baseURL: 'http://127.0.0.1:3000/api',
  timeout: 1000 * 60 * 5,
  interceptors: {
    // 请求拦截器
    requestInterceptors: (config) => {
      console.log('实例请求拦截器')
      return config
    },
    // 响应拦截器
    responseInterceptors: (res) => {
      console.log('实例响应拦截器:成功')

      return res
    },
    responseInterceptorsCatch(err) {
      console.log('实例响应拦截器:失败')
      // return err;
      return Promise.reject(err)
    }
  }
})
